package cn.bellychang.ood.srp.good;

/**
 * @author ChangLiang
 * @date 2020/5/12
 */
public class CourseService {

    public void chooseCourse(Student student, CourseOffering sc){
        //第一步：重构： canAttend ， 但是还有问题
        if(student.canAttend(sc.getCourse())
                && sc.getMaxStudent() > sc.getStudents().size()){
            sc.getStudents().add(student);
        }
    }


}
